A messaging system in a network environment may deliver messages from an application to one or more destinations in the network environment. Messages are typically grouped together into a data packet that is then transmitted to a destination. Encapsulating messages in a packet helps reduce communication overhead, and improves the average rate of successful message delivery. The maximum size of a packet is usually determined by a network setting called the Maximum Transfer Unit (MTU).
It is generally desirable to add as many messages as possible (e.g., within an upper bound determined according to the MTU) to a packet to increase transmission throughput. A real-time messaging system, however, may transmit a packet that is underutilized (i.e., a packet that is not optimally filled with individual messages) in order to comply with QoS requirements.
QoS provides applications with the ability to prioritize messages to achieve a certain level of performance in network communications by assigning a priority parameter to a message. To comply with QoS, a messaging system generally transmits the most urgent packet first. The most urgent packet is the packet including a message with the highest priority relative to the other messages.
In existing messaging systems in which messages are assigned priority according to QoS, an application submits messages to a batching module for transmission to one or more destinations. The batching module aggregates the messages into data packets and forwards the packets to a scheduling module upon finalization. The scheduling module transmits received packets based on urgency so that the packet including the most urgent message is transmitted first.
The batching module finalizes a packet either when a packet reaches a predetermined size threshold or when a packet exceeds a certain time limit determined according to QoS. If the batching module finalizes a packet based on packet size, the scheduling module's transmission of the finalized packet may violate QoS because there may be another packet in the queue with a higher priority that has not met the size threshold.
On the other hand, if the batching module finalizes a packet according to a certain time limit, the batching module may forward an underutilized packet to the scheduling module. The underutilization occurs because the transmission of a finalized packet may be delayed due to the scheduling module being busy transmitting other more urgent packets. If additional messages that can be added to the finalized packet arrive during this waiting period, the new messages cannot be added to the finalized packet. That is, once a packet is finalized and forwarded to the scheduling module, the batching module may not add additional messages to the packet while the packet is waiting for transmission.
Systems and methods are needed to overcome the above-mentioned shortcomings.